Git Bent Architecture

Git bent is used by: bent [commandgroup] [command]. commandgroup is the name of a file at SOURCE/code/core/commandgroup.bash. commandgroup.bash can import core/file or import internal/file. Function names are written as function commandgroup_command(). A command can have multiple spaces in the call from the user, meaning multiple underscores in the declaration. Meaning: [bent show history full] is written as function show_history_full(). I think it works with up to three words, so bent show something very long could be a command.

Stuff to know

  • NEVER use echo in production code. Use msg instead
  • You should use prompt_quit and prompt_choose when offering a choice to a user. code/core/new.bash has a pretty good example of prompt_choose_function. internal/prompt.bash has notes on how to use prompt_choose and prompt_quit.
  • bent core [command] can be called by bent [command].
  • shorthand/aliases are written at the top of a file. See code/core/switch.bash for an example
  • Colors are good. See code/internal/color-vars.bash. code/internal/msg.bash has examples of using color
  • I like organization. If you're not sure, just submit your PR & I'll let you know what I'd like.
  • Most TODOs are in the code. Write a comment like # @TODO the thing that needs done. Feel free to add more lines with your thoughts

Directory Structure

SOURCE_DIRECTORY/
    - bent // this script is added to PATH & routes commands to code/bent.bash
    - code/
        - bent.bash //sources essential files, parses command,
        - core/ // each file in here (pre dash) is a 'command group'
            - core.bash // imports core-alias.bash, core-rollback.bash & other core-*.bash files
            - core-alias.bash
            - new.bash 
            - //and so on. 
        - internal/ //where internal functions are stored, which are loaded on every single execution of bent
        - unused-old/ // old code that I may use at a later time